/***********************************************************************
 * Module:  Student.java
 * Author:  penwei
 * Purpose: 学生信息
 ***********************************************************************/

package cn.hdmis.entity;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import org.apache.struts2.json.annotations.JSON;
/**
 * 项目名称：hdmis1.1
 * 类名称：Student
 * 类描述：学生实体
 * 创建人：Administrator
 * 创建时间：2013-2-13 下午02:46:33
 * 修改人：Administrator
 * 修改时间：2013-2-13 下午02:46:33
 * 修改备注：
 * @version 
 *
 */
public class Student implements java.io.Serializable {
	private static final long serialVersionUID = -8891935643688923960L;
	/**	编号 */
	private Long id;
	/**	姓名 */
	private String name;
	/**	民族 */
	private String nation;
	/**	性别 */
	private Integer sex;
	/**	籍贯 */
	private String origin;
	/**	照片 */
	private String photo;
	/**	入校时间 */
	private Date inDate;
	/**	离校时间 */
	private Date outDate;
	/**	生日 */
	private Date birthday;
	/**	家庭住址 */
	private String address;
	/**	家庭电话 */
	private String fphone;
	/**	登记时间 */
	private Date regdate;
	/**	托管类型 */
	private Integer studentType;
	/**	接送方式 */
	private Integer gotoType;
	/**	学生是否离校 */
	private Boolean status;
	/** 一学生对应多个班级，如兴趣班、班级调换 */
	private Set<StudentGrade> studentGradeSet = new HashSet<StudentGrade>();
	/** 学生老师多对多 */
	private Set<Teacher> teachersSet = new HashSet<Teacher>();
	/** 一学生对多条操作记录  */
	private Set<OpRecord>  OpRecordSet = new HashSet<OpRecord>();
	/** 一个学生对应多条收费记录 */
	private Set<Tuition> tuitionSet = new HashSet<Tuition>();
	/** 一个学生对应多个监护人 */
	private Set<Guardian> guardiansSet = new HashSet<Guardian>();
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getNation() {
		return nation;
	}
	public void setNation(String nation) {
		this.nation = nation;
	}
	public Integer getSex() {
		return sex;
	}
	public void setSex(Integer sex) {
		this.sex = sex;
	}
	public String getOrigin() {
		return origin;
	}
	public void setOrigin(String origin) {
		this.origin = origin;
	}
	public String getPhoto() {
		return photo;
	}
	public void setPhoto(String photo) {
		this.photo = photo;
	}
	@JSON(format="yyyy-MM-dd")
	public Date getInDate() {
		return inDate;
	}
	public void setInDate(Date inDate) {
		this.inDate = inDate;
	}
	@JSON(format="yyyy-MM-dd")
	public Date getOutDate() {
		return outDate;
	}
	public void setOutDate(Date outDate) {
		this.outDate = outDate;
	}
	@JSON(format="yyyy-MM-dd")
	public Date getBirthday() {
		return birthday;
	}
	public void setBirthday(Date birthday) {
		this.birthday = birthday;
	}
	public String getAddress() {
		return address;
	}
	public void setAddress(String address) {
		this.address = address;
	}
	public String getFphone() {
		return fphone;
	}
	public void setFphone(String fphone) {
		this.fphone = fphone;
	}
	@JSON(format="yyyy-MM-dd")
	public Date getRegdate() {
		return regdate;
	}
	public void setRegdate(Date regdate) {
		this.regdate = regdate;
	}
	public Integer getStudentType() {
		return studentType;
	}
	public void setStudentType(Integer studentType) {
		this.studentType = studentType;
	}
	public Integer getGotoType() {
		return gotoType;
	}
	public void setGotoType(Integer gotoType) {
		this.gotoType = gotoType;
	}
	public Boolean getStatus() {
		return status;
	}
	public void setStatus(Boolean status) {
		this.status = status;
	}
	public Set<StudentGrade> getStudentGradeSet() {
		return studentGradeSet;
	}
	public void setStudentGradeSet(Set<StudentGrade> studentGradeSet) {
		this.studentGradeSet = studentGradeSet;
	}
	public Set<Teacher> getTeachersSet() {
		return teachersSet;
	}
	public void setTeachersSet(Set<Teacher> teachersSet) {
		this.teachersSet = teachersSet;
	}
	public Set<OpRecord> getOpRecordSet() {
		return OpRecordSet;
	}
	public void setOpRecordSet(Set<OpRecord> opRecordSet) {
		OpRecordSet = opRecordSet;
	}
	public Set<Tuition> getTuitionSet() {
		return tuitionSet;
	}
	public void setTuitionSet(Set<Tuition> tuitionSet) {
		this.tuitionSet = tuitionSet;
	}
	public Set<Guardian> getGuardiansSet() {
		return guardiansSet;
	}
	public void setGuardiansSet(Set<Guardian> guardiansSet) {
		this.guardiansSet = guardiansSet;
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((OpRecordSet == null) ? 0 : OpRecordSet.hashCode());
		result = prime * result + ((address == null) ? 0 : address.hashCode());
		result = prime * result
				+ ((birthday == null) ? 0 : birthday.hashCode());
		result = prime * result + ((fphone == null) ? 0 : fphone.hashCode());
		result = prime * result
				+ ((gotoType == null) ? 0 : gotoType.hashCode());
		result = prime * result
				+ ((studentGradeSet == null) ? 0 : studentGradeSet.hashCode());
		result = prime * result
				+ ((guardiansSet == null) ? 0 : guardiansSet.hashCode());
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		result = prime * result + ((inDate == null) ? 0 : inDate.hashCode());
		result = prime * result + ((name == null) ? 0 : name.hashCode());
		result = prime * result + ((nation == null) ? 0 : nation.hashCode());
		result = prime * result + ((origin == null) ? 0 : origin.hashCode());
		result = prime * result + ((outDate == null) ? 0 : outDate.hashCode());
		result = prime * result + ((photo == null) ? 0 : photo.hashCode());
		result = prime * result + ((regdate == null) ? 0 : regdate.hashCode());
		result = prime * result + ((sex == null) ? 0 : sex.hashCode());
		result = prime * result + ((status == null) ? 0 : status.hashCode());
		result = prime * result
				+ ((studentType == null) ? 0 : studentType.hashCode());
		result = prime * result
				+ ((teachersSet == null) ? 0 : teachersSet.hashCode());
		result = prime * result
				+ ((tuitionSet == null) ? 0 : tuitionSet.hashCode());
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Student other = (Student) obj;
		if (OpRecordSet == null) {
			if (other.OpRecordSet != null)
				return false;
		} else if (!OpRecordSet.equals(other.OpRecordSet))
			return false;
		if (address == null) {
			if (other.address != null)
				return false;
		} else if (!address.equals(other.address))
			return false;
		if (birthday == null) {
			if (other.birthday != null)
				return false;
		} else if (!birthday.equals(other.birthday))
			return false;
		if (fphone == null) {
			if (other.fphone != null)
				return false;
		} else if (!fphone.equals(other.fphone))
			return false;
		if (gotoType == null) {
			if (other.gotoType != null)
				return false;
		} else if (!gotoType.equals(other.gotoType))
			return false;
		if (studentGradeSet == null) {
			if (other.studentGradeSet != null)
				return false;
		} else if (!studentGradeSet.equals(other.studentGradeSet))
			return false;
		if (guardiansSet == null) {
			if (other.guardiansSet != null)
				return false;
		} else if (!guardiansSet.equals(other.guardiansSet))
			return false;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		if (inDate == null) {
			if (other.inDate != null)
				return false;
		} else if (!inDate.equals(other.inDate))
			return false;
		if (name == null) {
			if (other.name != null)
				return false;
		} else if (!name.equals(other.name))
			return false;
		if (nation == null) {
			if (other.nation != null)
				return false;
		} else if (!nation.equals(other.nation))
			return false;
		if (origin == null) {
			if (other.origin != null)
				return false;
		} else if (!origin.equals(other.origin))
			return false;
		if (outDate == null) {
			if (other.outDate != null)
				return false;
		} else if (!outDate.equals(other.outDate))
			return false;
		if (photo == null) {
			if (other.photo != null)
				return false;
		} else if (!photo.equals(other.photo))
			return false;
		if (regdate == null) {
			if (other.regdate != null)
				return false;
		} else if (!regdate.equals(other.regdate))
			return false;
		if (sex == null) {
			if (other.sex != null)
				return false;
		} else if (!sex.equals(other.sex))
			return false;
		if (status == null) {
			if (other.status != null)
				return false;
		} else if (!status.equals(other.status))
			return false;
		if (studentType == null) {
			if (other.studentType != null)
				return false;
		} else if (!studentType.equals(other.studentType))
			return false;
		if (teachersSet == null) {
			if (other.teachersSet != null)
				return false;
		} else if (!teachersSet.equals(other.teachersSet))
			return false;
		if (tuitionSet == null) {
			if (other.tuitionSet != null)
				return false;
		} else if (!tuitionSet.equals(other.tuitionSet))
			return false;
		return true;
	}


}